diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-26 16:58:27 +0100 |
|---|---|---|
| committer | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-26 16:58:27 +0100 |
| commit | f4eb8b6fc931f7ded138dceb2b9df4c63ac7e353 (patch) | |
| tree | ca189d7ff7beb80a2626c0747a367e745374cf78 /src/pages/[locale]/rss.xml.ts | |
| parent | c8f9f07197fa49ad114a30d4c40bdf24443acc3a (diff) | |
Differentiates getLocaleFromPath failure strategies
Diffstat (limited to 'src/pages/[locale]/rss.xml.ts')
| -rw-r--r-- | src/pages/[locale]/rss.xml.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pages/[locale]/rss.xml.ts b/src/pages/[locale]/rss.xml.ts index b3cb22f..9d2e34b 100644 --- a/src/pages/[locale]/rss.xml.ts +++ b/src/pages/[locale]/rss.xml.ts @@ -2,7 +2,7 @@ import rss, { RSSFeedItem } from '@astrojs/rss'; import { CollectionEntry, getCollection } from 'astro:content'; import { getDate, getHref, isNewsItemInLocale } from '$lib/newsUtils'; import localeStaticPaths from '$lib/localeStaticPaths'; -import getLocaleFromPath from '$lib/getLocaleFromPath'; +import { getLocaleFromPathOrThrow } from '$lib/getLocaleFromPath'; import type { APIContext } from 'astro'; import translate from '$i18n/translate'; import tFeed from '$i18n/translations/pages/rss.xml'; @@ -13,7 +13,7 @@ import type Scotsoun from '$types/Scotsoun'; import { getAllScotsoun } from '$data/scotsoun'; export async function get(context: APIContext) { - const locale = getLocaleFromPath(context.url.pathname); + const locale = getLocaleFromPathOrThrow(context.url.pathname); const t = translate(locale); const site = context.site; if (!site) { |
